package com.hsgene.user.dto.user.manager;

import com.hsgene.common.util.web.session.UserSession;
import com.hsgene.user.domain.Employee;
import com.hsgene.user.domain.ManagerAccount;
import com.hsgene.user.domain.User;
import com.hsgene.user.dto.user.AbstractUserDto;

import java.io.Serializable;

/**
 * 超级管理员信息Dto
 *
 * @author wangbing
 * @version 1.0, 2018/7/11
 */
public class ManagerDto extends AbstractUserDto implements Serializable {

    private static final long serialVersionUID = -8351615949812879729L;

    /**
     * 是否为普通管理员
     */
    private boolean normal = true;

    /**
     * 超级管理员信息（normal = false时此字段有值）
     */
    private SuperManager superManager;

    /**
     * 普通管理员信息（normal = true时此字段有值）
     */
    private NormalManager normalManager;

    /**
     * 用户会话信息
     */
    private UserSession userSession;

    public void buildAndSetNormalManager(User user, Employee employee) {
        this.normalManager = new NormalManager(user, employee);
    }

    public void buildAndSetSuperManager(ManagerAccount account) {
        this.superManager = new SuperManager(account);
    }

    public boolean getNormal() {
        return normal;
    }

    public void setNormal(boolean normal) {
        this.normal = normal;
    }

    public SuperManager getSuperManager() {
        return superManager;
    }

    public void setSuperManager(SuperManager superManager) {
        this.superManager = superManager;
    }

    public NormalManager getNormalManager() {
        return normalManager;
    }

    public void setNormalManager(NormalManager normalManager) {
        this.normalManager = normalManager;
    }

    public UserSession getUserSession() {
        return userSession;
    }

    public void setUserSession(UserSession userSession) {
        this.userSession = userSession;
    }
}
